#include<bits/stdc++.h>
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define mid ((l+r)>>1)
#define File(xxx) freopen(xxx".in","r",stdin),freopen(xxx".out","w",stdout)
using namespace std;
namespace IO{
    char buff[1<<21],*p1=buff,*p2=buff;
    char getch(){
        return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;
    }
    template<typename T>
    void read(T &x){
        char ch=getch();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    char obuf[1<<21],*p3=obuf;
    void putch(char ch){
        if(p3-obuf<(1<<21))*p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    void pc(const char *s){
    	while(*s)putch(*s),s++;
    }
    char ch[100];
    template<typename T>
    void write(T x){
        if(!x)return putch('0');
        if(x<0)putch('-'),x*=-1;
        int top=0;
        while(x)ch[++top]=x%10+48,x/=10;
        while(top)putch(ch[top]),top--;
    }
    template<typename T,typename ...Args>
    void write(T x,Args ...args){
        write(x),putch(' '),write(args...);
    }
    void flush(){fwrite(obuf,p3-obuf,1,stdout);p3=obuf;}
}
using namespace IO;
const int N=1e5+5;
int n,m,_;
bool vis[N];
int fa[N];
inline int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
int f[N],d[N],g[N];
vector<int>to[N];
vector<pair<int,int>>ans;
void dfs(int x,int p){
	f[x]=p;
	d[x]=d[p]+1;
	if(vis[x])g[x]=x;
	for(auto y:to[x]){
		if(y==p)continue;
		dfs(y,x);
		if(!g[y])continue;
		if(g[x])ans.push_back({g[x],g[y]}),g[x]=0;
		else g[x]=g[y];
	}
}
void Out(int x,int y){
	vector<int>s1,s2;
	if(d[x]<d[y])swap(x,y);
	while(d[x]>d[y]){
		s1.push_back(x);
		x=f[x];
	}
	if(x==y){
		s1.push_back(x);
		write(s1.size()),putch(' ');
		for(auto t:s1)write(t),putch(' ');
		return putch('\n');
	}
	while(x!=y){
		s1.push_back(x);
		s2.push_back(y);
		x=f[x],y=f[y];
	}
	s1.push_back(x);
	reverse(s2.begin(),s2.end());
	write(s1.size()+s2.size()),putch(' ');
	for(auto t:s1)write(t),putch(' ');
	for(auto t:s2)write(t),putch(' ');
	return putch('\n');
}
signed main(){
	File("travel");
	read(n,m,_);
	for(int i=1;i<=n;i++)
		fa[i]=i;
	for(int i=1;i<=m;i++){
		int x,y;
		read(x,y);
		int X=find(x),Y=find(y);
		if(X^Y){
			fa[X]=Y;
			to[x].push_back(y);
			to[y].push_back(x);
		}
	}
	for(int i=1;i<=_;i++){
		int x;read(x);
		vis[x]=1;
	}
	for(int i=1;i<=n;i++)if(!d[i])
		dfs(i,0);
	write(ans.size()),putch('\n');
	for(auto t:ans)
		Out(t.first,t.second);
	return flush(),0;
}

